import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/global.css'
import { Button, Select, Form, FormItem, Input, Message, Container, Header, Aside, Main, Card } from 'element-ui';
import './assets/css/fonts/iconfont.css'
import axios from 'axios'
axios.defaults.baseURL = ' https://lianghj.top:8888/api/private/v1/'

Vue.prototype.$http = axios
Vue.config.productionTip = false
axios.interceptors.request.use(config => {
    console.log(config);
    config.headers.Authorization = window.sessionStorage.getItem('token')
    return config
})


Vue.use(ElementUI);
Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
Vue.component(Form.name, Form);
Vue.use(FormItem);
Vue.use(Input);
Vue.use(Container);
Vue.use(Header);
Vue.use(Aside);
Vue.use(Main);
Vue.use(Card);


//把Message挂载到了vue原型上，这样可以this.$message使用， $message为自定义属性，可以自行修改
Vue.prototype.$message = Message


new Vue({
    router,
    render: h => h(App)
}).$mount('#app')